# $Id: PKGBUILD 87496 2013-04-01 18:10:58Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Leif Warner <abimelech@gmail.com>

pkgname=sbt
epoch=1
pkgver=0.12.3
pkgrel=1
pkgdesc="A minimally intrusive build tool for Scala projects"
arch=('any')
url='http://www.scala-sbt.org/'
license=('BSD')
depends=('java-runtime-headless' 'sh')
optdepends=('scala')
source=("http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/${pkgname}/${pkgver}/${pkgname}.tgz")
md5sums=('a4a8cec472e79e1f4788f0ad744f4f17')

package() {
  cd sbt/bin
  install -d "${pkgdir}/usr/share/java/${pkgname}/"
  install -m644 {jansi,sbt-launch}.jar "${pkgdir}/usr/share/java/${pkgname}/"
  install -m755 sbt sbt-launch-lib.bash "${pkgdir}/usr/share/java/${pkgname}/"

  install -d "${pkgdir}"/usr/bin/
  ln -s "/usr/share/java/${pkgname}/sbt" "${pkgdir}"/usr/bin/sbt

  install -d "${pkgdir}"/etc/${pkgname}/
  touch "${pkgdir}"/etc/${pkgname}/sbtopts

  install -d "${pkgdir}/usr/share/licenses/${pkgname}/"
  install -m644 ../jansi-license.txt "${pkgdir}/usr/share/licenses/${pkgname}/"
}
